package Reader;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Demo3 {
    public static void main(String[] args) throws Exception {
        InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream("D:\\test\\b.txt"));
        int read=-1;
        /*while ((read=inputStreamReader.read())!=-1){
            System.out.println(read);
        }*/
        char[]buff =new char[22];//从文件中读取数据存于本地位置
        while ((read=inputStreamReader.read(buff))!=-1){
            System.out.println(new String(buff,0,read));
        }
      inputStreamReader.close();
    }
}
